#pragma GCC optimize(2)
#include <iostream>
#include <queue>
#include <map>
#include <unordered_map>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <set>
#include <unordered_set>
#define IOS ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
ll a[100010];
int main()
{
	IOS;
	int t;
	cin>>t;
	while(t--)
	{
		int n;
		cin>>n;
		for(int i=1;i<=n;i++) cin>>a[i];
		ll num=0;
		ll suma=0;
		for(int i=1;i<=n;i++)
		{
			suma+=a[i];
			if(a[i]==1) num++;
		}
//		cout<<suma<<' '<<n+num<<endl;
		if(suma>=n+num && n>1) cout<<"YES"<<endl;
		else cout<<"NO"<<endl; 
	}

	return 0;
}

